public class Select {
    public static void main(String[] args) {
        int[] arr = {11,18,24,35,46,57,68,79,99,100};
        Select select = new Select();
        int i = select.find(arr,0,arr.length,99);
        System.out.println(i);
    }

    int find(int[] arr,int low,int high,int target){
        if (low >= high){
            return -1;
        }
        int mid = (low + high) / 2;
        if (target == arr[mid]){
            return mid;
        }else if(arr[mid] > target){
            return find(arr,low,mid-1,target);
        }else {
            return find(arr,mid+1,high,target);
        }
    }
}
